# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=metagoofil
pkgver=93.8d50624
pkgrel=1
groups=('blackarch' 'blackarch-recon')
pkgdesc='An information gathering tool designed for extracting metadata of public documents.'
url='http://www.edge-security.com/metagoofil.php'
arch=('any')
license=('GPL3')
depends=('python' 'python-requests' 'python-google')
makedepends=('git')
#source=("http://www.edge-security.com/soft/$pkgname-$pkgver.tar")
#source=("git+https://github.com/laramies/$pkgname.git")
source=("git+https://github.com/opsdisk/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i "s|user_agents.txt|/usr/share/$pkgname/user_agents.txt|g" "$pkgname.py"
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -m 644 user_agents.txt "$pkgdir/usr/share/$pkgname/user_agents.txt"
  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/doc/" README.md
  install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}

